import numpy as np
import cv2

if __name__ == '__main__':
    img = np.zeros((300, 300, 3), dtype=np.uint8)
    img[0:300,0:100,0] = 255
    img[0:300,100:200,1] = 255
    img[0:300,200:300,2] = 255
    cv2.imshow('img', img)
    cv2.waitKey(0)
    cv2.destroyAllWindows()